package com.zbkj.front.controller.zb;

import com.zbkj.common.model.user.User;
import com.zbkj.common.request.UpdateUserFrontRequest;
import com.zbkj.common.result.CommonResult;
import com.zbkj.service.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("api/front/user")
@Api(tags = "前端用户相关")
@Slf4j
public class ZbUserController {

//    @Autowired
//    public ZbUserService zbUserService;
    @Autowired
    private UserService userService;

    @PostMapping("/update")
    @ApiOperation("更新用户信息")
    public CommonResult updateUserInfo(@RequestBody UpdateUserFrontRequest param) {

//        zbUserService.updateUserInfo(param);

        return CommonResult.success();
    }

    @GetMapping("/info")
    @ApiOperation(value = "获取用户信息")
    public CommonResult<User> getUserInfo() {
        return CommonResult.success(userService.getById(userService.getUserIdException()));
    }
}
